import request from '@/utils/request'

// 志愿者签到
export function signIn(data) {
  return request({
    url: '/activity/record/sign-in',
    method: 'post',
    data
  })
}

// 志愿者签退
export function signOut(data) {
  return request({
    url: '/activity/record/sign-out',
    method: 'post',
    data
  })
}

// 补录签到记录
export function addRecord(data) {
  return request({
    url: '/activity/record/add',
    method: 'post',
    data
  })
}

// 审核签到记录
export function reviewRecord(data) {
  return request({
    url: `/activity/record/review/${data.id}`,
    method: 'post',
    data: {
      status: data.status,
      rejectReason: data.rejectReason,
      reviewerId: data.reviewerId
    }
  })
}

// 获取签到记录列表
export function getRecordList(params) {
  return request({
    url: '/activity/record/list',
    method: 'get',
    params
  })
}

// 获取签到记录详情
export function getRecordDetail(id) {
  return request({
    url: `/activity/record/${id}`,
    method: 'get'
  })
}

// 删除签到记录
export function deleteRecord(id) {
  return request({
    url: `/activity/record/${id}`,
    method: 'delete'
  })
}

// 批量删除签到记录
export function batchDeleteRecord(data) {
  return request({
    url: '/activity/record/batch',
    method: 'delete',
    data
  })
} 